import { createApp } from 'vue';
import App from './App.vue';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import router from './router'; // 确保引入了路由配置
import axios from 'axios';
import VueAxios from 'vue-axios';

const app = createApp(App);

app.use(ElementPlus);
app.use(VueAxios, axios);
app.provide('axios', app.config.globalProperties.axios); // 提供 axios 实例
app.config.globalProperties.$axios = axios; // 挂载 axios 到全局属性

axios.defaults.baseURL = process.env.VUE_APP_API_BASE_URL;

app.use(router); // 确保使用了路由

app.mount('#app');
